#include <iostream>
#include <stdio.h>

using namespace std;

int main() {
    int n,a;
    cin >> a;
    n = 19;
    while (n % a != 0){
        n += 20;
    }
    cout << n;
    return 0;
}